﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Salient.Web.Administration
{
    public partial class WebAdminWithConfirmationNoButtonRow : System.Web.UI.MasterPage
    {

        private string _directionality;

        public string Directionality
        {
            get
            {
                if (String.IsNullOrEmpty(_directionality))
                {
                    _directionality = ((string)GetGlobalResourceObject("GlobalResources", "HtmlDirectionality")).ToLower();
                }
                return _directionality;
            }
        }

        public string DirectionalityLeft
        {
            get
            {
                if (Directionality == "rtl")
                {
                    return "right";
                }
                else
                {
                    return "left";
                }
            }
        }

        public string DirectionalityRight
        {
            get
            {
                if (Directionality == "rtl")
                {
                    return "left";
                }
                else
                {
                    return "right";
                }
            }
        }

        // This can be called by the controls in content (e.g. via event handler)
        public void SetDisplayUI(bool showConfirmation)
        {
            if (showConfirmation)
            {
                ((webAdmin)Master).SetNavigationBarVisibility(false);
                titleBar.Visible = false;
                content.Visible = false;
                confirmation.Visible = true;
            }
            else
            {
                ((webAdmin)Master).SetNavigationBarVisibility(true);
                titleBar.Visible = true;
                content.Visible = true;
                confirmation.Visible = false;
            }
        }

    }
}
